﻿using Microsoft.Phone.Controls;
using System.ComponentModel;
using System.Windows;

namespace wp7cinema.View
{
    /// <summary>
    /// Description for TicketingInfoView.
    /// </summary>
    public partial class TicketingInfoView : PhoneApplicationPage
    {
        /// <summary>
        /// Initializes a new instance of the TicketingInfoView class.
        /// </summary>
        public TicketingInfoView()
        {
            InitializeComponent();
        }

        protected override void OnBackKeyPress(CancelEventArgs e)
        {
            e.Cancel = true;
            OpenAndClose.CurrentStateChanged += GoBack;
            VisualStateManager.GoToState(this, "Back", true);
        }

        void GoBack(object sender, VisualStateChangedEventArgs e)
        {
            OpenAndClose.CurrentStateChanged -= GoBack;
            NavigationService.GoBack();
        }
    }
}